package com.onlyphoto.onlymall.mvp.model

import com.onlyphoto.onlymall.api.Urls
import com.onlyphoto.onlymall.base.BaseModel
import com.onlyphoto.onlymall.base.BaseObserver
import com.onlyphoto.onlymall.bean.request.LoginBean
import com.onlyphoto.onlymall.bean.response.UserInfoBean
import com.onlyphoto.onlymall.utils.ConfigUtil
import com.onlyphoto.onlymall.utils.RxTransformer


class MLoginByPwdImpl : BaseModel() {
    fun loginByPwd(bean: LoginBean, baseObserver: BaseObserver<UserInfoBean>) {
        val url = ConfigUtil.instance.getUrl(Urls.LOGIN)
        apiService().loginByPwd(url, bean.toMap())
                .compose(RxTransformer.switchSchedulers(this))
                .subscribe(baseObserver)
    }
}
